package com.lcx.plugin.service;

import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.ServiceManager;
import com.lcx.plugin.dto.MySettingsStorageDTO;
import com.lcx.plugin.service.impl.MySettingsStorageServiceImpl;

/**
 * @author lcx
 * @version 1.0.0
 * @date 2021/08/07 11:55
 */
public interface MySettingsStorageService extends PersistentStateComponent<MySettingsStorageDTO> {
    /**
     * 获取实例
     *
     * @return {@link MySettingsStorageService}
     */
    static MySettingsStorageService getInstance() {
        return ServiceManager.getService(MySettingsStorageServiceImpl.class);
    }

    /**
     * 获取设置存储
     *
     * @return {@link MySettingsStorageDTO}
     */
    static MySettingsStorageDTO getSettingsStorage() {
        return getInstance().getState();
    }
}
